﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Permissions;
using System.Windows.Forms;

namespace iPdf
{
    partial class ProgressDialog : Form
    {
        public delegate void CancelCallback();
        public event CancelCallback UserCancelled;
        public ProgressDialog()
        {
            InitializeComponent();
        }

        private const int CP_NOCLOSE_BUTTON = 0x200;
        
        
        protected override CreateParams CreateParams
        {
            [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
            get
            {
                CreateParams mdiCp = base.CreateParams;
                mdiCp.ClassStyle |= CP_NOCLOSE_BUTTON;
                return mdiCp;
            }
        }

        private void Cancel_Click(object sender, EventArgs e)
        {
            if (UserCancelled != null)
            {
                UserCancelled();
            }
        }

    }
}
